package com.cn.kabalifemerchants.callback.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;

import com.cn.kabalifemerchants.R;


/**
 * Created by xiaolin on 2018/8/2.
 * function   网络加载dig
 */

public class CallbackDialog extends Dialog {
    protected Context mContext;

    protected WindowManager.LayoutParams mLayoutParams;

    RotateLoading rotateLoading;

    public RotateLoading getRotateLoading() {
        return rotateLoading;
    }

    public void setRotateLoading(RotateLoading rotateLoading) {
        this.rotateLoading = rotateLoading;
    }

    public CallbackDialog(Activity context) {
        super(context);
        initView(context);
    }


    private void initView(Context context) {
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.getWindow().setBackgroundDrawableResource(R.drawable.transparent_bg);
        mContext = context;
        Window window = this.getWindow();
        mLayoutParams = window.getAttributes();
        mLayoutParams.alpha = 1f;
        window.setAttributes(mLayoutParams);
        if (mLayoutParams != null) {
            mLayoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
            mLayoutParams.gravity = Gravity.CENTER;
        }
        View dialogView = LayoutInflater.from(getContext()).inflate(R.layout.app_rotateloading, null);

        rotateLoading = dialogView.findViewById(R.id.rotateloading);
        setContentView(dialogView);

    }


}
